package com.diaosidadui.test02;

public class Test03 {
    public static void main(String[] args) {
        String st = "abc123";

/*
        String st2 =st.substring(1,7);
        System.out.println(st2);
        System.out.println(st.subSequence(1, 7));
*/


/*        char[] chs ={'a','b','c','d','e','f','g','h'};

        String st2 = new String(chs);
        System.out.println(st ==st2);
        System.out.println(st.equals(st2));*/
        //字符串遍历
        int count1 = 0, count2 = 0, count3 = 0;
        System.out.println(st.length());
/*        for (int i = 0; i < st.length(); i++) {
            System.out.println(st.charAt(i));
        }*/
        for (int i = 0; i < st.length(); i++) {
            char c = st.charAt(i);
            if (c >= '0' && c <= '9') {
                count1++;
            }
            if (st.charAt(i) >= 'a' && st.charAt(i) <= 'z') {

            }
            if (st.charAt(i) >= 'A' && st.charAt(i) <= 'Z') {

            }

        }System.out.println(count1);
        int c=0;
        char[] ch = st.toCharArray();
        for (int i = 0; i < ch.length; i++) {
            if(ch[i]>=0&&ch[i]<=9){
                c++;
            }
        }
        System.out.println(c);


    }
}
